<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>

  <style>
    #container {
      width: 800px;
      height: 400px;
    }
  </style>
</head>
<body>  
  <!-- 2.准备具备宽高的DOM容器 -->
  <div id="container"></div>
  <!-- 1.引入echarts js 文件 -->
  <!-- <script src="https://cdn.jsdelivr.net/npm/echarts@5.4.0/dist/echarts.min.js"></script> -->
  <script src="https://cdn.jsdelivr.net/npm/echarts@4.7.0/dist/echarts.min.js"></script>
  <script>
    // 3. 初始化echarts 的实例
    const myEcharts = echarts.init(document.querySelector("#container"));
    // 4.定义图表配置项potion
    const option = {
        color: ["#c23531"],
        // 标题
        title: {
          text: "柱形图",
          left: "center",
        },
        // x轴
        xAxis: {
          data: ["食品", "数码", "服饰", "箱包"],
        },
        // y轴
        yAxis: {
          // 轴线
          axisLine: {
            show: true,
          },
          // 刻度线
          axisTick: {
            show: true,
          },
        },
        // 提示框
        tooltip: {},
        // 系列：指定图表类型和图表渲染的数据
        series: {
          type: "pie", // 图表的类型
          data: [90, 120, 100, 110],
        },
      };
    // 渲染图表
    myEcharts.setOption(option);
  </script>
</body>
</html>